package com.patttern.creativity.factory.simplefactory;

/**
 * @Author: root
 * @Date: 2018/11/16 18:20
 */
public class CarFactory {
    /**
     * 第一种
     *
     * @param name
     * @return
     */
    public static Car createCar(String name) {
        if ("byd".equals(name)) {
            return new Byd();
        } else if ("audi".equals(name)) {
            return new Audi();
        } else {
            return null;
        }
    }

    public static Car createAudi() {
        return new Audi();
    }

    public static Car createByd() {
        return new Byd();
    }
}
